* {
  word-break: break-all;
}

body {
  display: grid;
  grid-template-rows: auto 1fr 24px;
  grid-template-columns: 200px 1fr;
  height: 100%;
  max-height: 100%;
}

#sidebar {
  display: flex;
  flex-direction: column;
  grid-row: 2 / 3;
  grid-column: 1 / 2;
  background: #F5F4F5;
  border-right: 1px solid #c2c0c2;
}
#content {
  /* flex-direction: column; */
  grid-row: 2 / 3;
  grid-column: 2 / 3;
  display: grid;
  grid-template-rows: 1fr 160px;
}
#rx-region, #tx-region {
  background-color: #F6F6F6;
  border: 1px solid #c2c0c2;
  border-radius: 5px;
  margin: 5px;
  display: flex;
  flex-direction: column;
}
#rx-region {
  /* max-height: 100%; */
  grid-row: 1/2;
}
#tx-region {
  height: 160px;
  margin-top: 0px;
  grid-row: 2/3;
}

footer {
  grid-row: 3 / 4;
  grid-column: 1 / 3;
  display: flex;
  justify-content: center;
}
footer > p {
  padding: 0;
  margin: 0;
}
footer span:not(:last-child):after {
  content: ' |';
}

#sidebar .basic-setup {
  display: grid;
  grid-template-rows: auto;
  grid-template-columns: 1fr 2fr;
}
.basic-setup > .column1 {
  grid-column: 1 / 2;
}
.basic-setup > .column2 {
  grid-column: 2 / 3;
  max-width: 130px;
  overflow: hidden;
}
#open-device {
  grid-column: 2/3;
}
#sidebar ul {
  list-style: none;
}
#rx-display-setup, #tx-setup {
  display: flex;
  flex-direction: row;
  align-items: center;
  height: auto;
  margin: 2px;
}

#rx-content {
  display: flex;
  flex: 1;
  flex-direction: column;
}
textarea {
  resize: none;
  background-color: #FFF;
}
#tx-content > textarea {
  flex: 1;
  border: 0;
  border-top: 1px solid #c2c0c2;
  border-bottom: 1px solid #c2c0c2;
  border-right: 1px solid #c2c0c2;
}
#rx-display-area {
  font-family: monospace;
  flex: 1;
  height: 600px;
}
#textarea-rx, #display-list {
  width: 100%;
  height: 100%;
  border: 0;
  border-top: 1px solid #c2c0c2;
  border-bottom: 1px solid #c2c0c2;
  flex: 1;
}
#textarea-rx:focus {
  outline: none;
}
#display-list p {
  margin: 0;
  padding: 0;
  border-bottom: 1px solid #c2c0c2;
  background-image: linear-gradient(to bottom, #e8e6e8 0, #d1cfd1 100%);
  word-break: break-all;
}
#display-list {
  overflow-y: scroll;
  overflow-x: hidden;
}
#tx-content {
  display: flex;
  flex-direction: row;
  flex: 1;
}
#tx-setup > label {
  margin-left: 5px;
  margin-bottom: 0;
}
#btn-loopback {
  width: 78px;
  margin-left: auto;
}
#btn-send-data {
  width: 80px;
  margin-left: 5px;
}

.middleware-line:first-child {
  border-top: 1px solid #c2c0c2;
}
.middleware-line {
  display: grid;
  grid-template-columns: 1fr 1rem 1rem 1rem 1rem;
  border-bottom: 1px solid #c2c0c2;
  background-image: linear-gradient(to bottom, #F2F2F8 0, #E2E2DA 100%);
}
fieldset {
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 0;
  margin-bottom: 10px;
  border-width: 2px;
}
fieldset > legend {
  font-weight: bold;
}
.middleware-line > span {
  display: none;
}
.middleware-line:hover > span {
  display: inline-block;
}
.middleware-line > span:hover {
  color: goldenrod;
}
.middleware-name {
  overflow: hidden;
}

label {
  margin-bottom: 0;
}

#shadow-mask {
  position: absolute;
  height: 100%;
  width: 100%;
  background-color: rgba(180, 180, 180, 0.5);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  display: none;
}

.popup {
  position: absolute;
  z-index: 1000;
  background-color: #F8F8F8;
  border: 1px solid #c2c0c2;
  border-radius: 10px;

  min-width: 480px;
  min-height: 320px;
  display: flex;
  flex-direction: column;

  box-shadow: 6px 6px 4px gray;
}
.popup .header {
  background-image: linear-gradient(to bottom, #F2F2F8 0, #E2E2DA 100%);
  min-height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.popup .header .title {
  font-size: 1rem;
}

.popup .content {
  flex: 1;
  border-top: 1px solid #c2c0c2;
  border-bottom: 1px solid #c2c0c2;
  padding: 5px;
}
.popup .footer {
  background-image: linear-gradient(to bottom, #F2F2F8 0, #E2E2DA 100%);
  display: flex;
  flex-direction: row;
  align-items: right;
  justify-content: right;
}

.popup .footer button {
  display: block;
  margin: 10px;
  min-width: 80px;
  /* width: 80px; */
}
.popup .footer button:first-child {
  margin-left: auto;
}
#middleware-options input[type="radio"],
#middleware-options input[type="checkbox"] {
  margin-left: 2px;
  margin-right: 5px;
}
#display-list > p {
  cursor: copy;
}

.icon-down-circled {
  cursor: s-resize;
}
.icon-up-circled {
  cursor: n-resize;
}
.icon-cancel-squared, .icon-pencil {
  cursor: pointer;
}

button[disabled] {
  cursor: not-allowed;
}
